package me.zingon.doc.controller;


import me.zingon.doc.exception.ServiceException;
import me.zingon.doc.service.UserProjectService;
import me.zingon.doc.model.UserProject;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;


/**
* Created by ZTCGenerator<zingon@aliyun.com> on 2018-5-31.
*/
@RestController
@RequestMapping("/userproject")
public class UserProjectController extends BaseController{

    @Autowired
    UserProjectService userProjectService;

    @GetMapping("/{projectId}")
    public Object getByProjectId(@PathVariable("projectId")Integer projectId) throws ServiceException {
        return userProjectService.getByProjectIdWithUser(projectId,getUser());
    }
}
